package com.fg.ihr.repository;
import com.fg.ihr.domain.Department;
import com.fg.ihr.domain.User;
import com.fg.ihr.domain.Ward;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.List;


@Repository
public interface WardRepository extends JpaRepository<Ward, Integer>,JpaSpecificationExecutor<Ward> {

    @Query(nativeQuery = true,value="select w.id,w.wardname,w.department_id from ward w left join department d on w.department_id = d.id where w.department_id in :id")
    List<Ward> findWardList(@Param("id") List<Integer> id);


}
